/* File name: BufferedFPGALoopBack.c

	04Dec2007 .. initial version .. KMetzger

*/

#include<stdio.h>

// one frame is 352 x 288 = 101376
// get 2 pixels at a time, so 50688
#define FRAME_SIZE 50688 

unsigned long McBSP0_slave(unsigned long Value);
void McBSP0_slave_setup(int ws);

void setup_buffered_McBSP0(void);
unsigned GetFromMcBSP0(void);
void SendToMcBSP0(unsigned);

#pragma DATA_SECTION(frame_array, "SDRAMC");
int frame_array[FRAME_SIZE];

void main(void)
{
	unsigned utemp;
	int i=0;
	FILE *fid;
	fid = fopen("pimp2.txt","w");

	McBSP0_slave_setup(16);

		
	while(i<10000){
		utemp = McBSP0_slave((long) utemp);
		COOL_DATA[i]=utemp;
		
		i++;
	}

	printf("Done reading \n");

	i=0;		
	while(i<10000){	
		fprintf(fid,"%u\n",COOL_DATA[i]);
		i++;
	}	
	printf("Done pimpin' \n");
	fclose(fid);
}
